package com.wlf.html.service;

import com.wlf.html.dao.UserDao;
import com.wlf.html.model.User;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    @Transactional
    public boolean addUserInfo(User user) {
        userDao.addUserInfo(user);
        return true;
    }

    @Override
    @Transactional
    public int checkedUsername(String userName) {
        return userDao.checkedUsername(userName);
    }

    @Override
    @Transactional
    public User loginUserInfo(String username, String password) {
        return userDao.loginUserInfo(username,password);
    }

    @Override
    @Transactional
    public int deleteUserInfoId(Integer user_id) {
        return userDao.deleteUserInfoId(user_id);
    }

	@Override
	@Transactional
	public List<User> findAll() {
		// TODO Auto-generated method stub
		return userDao.findAll();
	}

	@Override
	@Transactional
	public List<User> findUserInfo(String user_id,String username, String phone) {
		// TODO Auto-generated method stub
		return userDao.findUserInfo(user_id,username,phone);
	}

}
